import requestbase from '@/utils/requestbase';
import { BASE_API_VERSION } from '@/utils';

// 获取 OSS Token
export const getOssToken = get => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/oss/token`,
  method: 'get'
});

// 上传 OSS之前 保存文件
export const saveOssFile = data => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/file/save`,
  method: 'post',
  data
});

// 获取 OSS 文件地址
export const getOssFileInfo = params => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/file/info`,
  method: 'get',
  params
});

// 获取用户信息
export const getUserInfo = () => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/homepage/personal/information`,
  method: 'get'
});

// 老师人员列表
export const getTeacherList = () => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/department/allTeacherAndTree`,
  method: 'get'
});

// 学生人员列表
export const getStudentList = () => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/grade/treeAndAllUser`,
  method: 'get'
});

// 课程列表
export const getCourseList = data => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/school/course/list/by/condition`,
  method: 'post',
  data
});

// 班级列表
export const getClassList = params => requestbase({
  url: `/base-platform/${BASE_API_VERSION}/base/grade/tree`,
  method: 'get',
  params
});